package com.khh.service.impl;

import com.khh.entity.User;
import com.khh.mapper.UserMapper;
import com.khh.service.UserService;
import com.khh.util.CommonMapper;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by webrx on 2017-09-23.
 */

@Slf4j
@Service
public class UserServiceImpl implements UserService {

    @Autowired(required = false)
    private UserMapper userMapper;

    @Override
    public List<User> query() {
        return userMapper.selectAll();
    }

    @Override
    public int insert(User user) {
        return userMapper.insertSelective(user);
    }

    @Override
    public User selectOne(User user) {
        return userMapper.selectOne(user);
    }
}
